function! GuiTabLabel()
	let label = ''
	let bufnrlist = tabpagebuflist(v:lnum)
	" 如果标签页里有修改过的缓冲区，加上 '+'
	for bufnr in bufnrlist
		if getbufvar(bufnr, "&modified")
			let label = '+'
			break
		endif
	endfor
	" 如果标签页里的窗口数目多于一，加上窗口数目
	let wincount = tabpagewinnr(v:lnum, '$')
	if wincount > 1
		let label ..= wincount
	endif
	if label != ''
		let label ..= ' '
	endif
	" 附加缓冲区名
	return label .. bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
endfunction

" Options:
set ambiwidth=double
set acd
set background=dark
set cmdheight=3
set conceallevel=1
set cursorcolumn
set cursorline
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,gb18030,euc-jp
set fdm=indent
set guitablabel=%{GuiTabLabel()}
set guioptions=egrL
set hidden
set hlsearch
set iminsert=0
set number
set noundofile
set nobackup
set noswapfile
set relativenumber
set noshellslash
set shiftwidth=4
set smartindent
set splitbelow
set splitright
set tabstop=4
set termencoding=utf-8
set visualbell
" set viminfofile=~/.viminfo
" set viminfo='100,<50,s10,h,rA:,rB:,n~/.viminfo
set viminfo='100,n$HOME/.viminfo
filetype plugin on
syntax on

if has('win32')
    set backupdir=$TEMP
else
    set backupdir=/tmp
endif
if exists('&smoothscroll')
	set smoothscroll
endif
if !exists("g:current_colorscheme")
    if has('gui_running')
        colorscheme evening
    else
        colorscheme darkblue
    endif
endif
